// Bottom of page
(function($, win, doc) {
	var a = $(win),
		b = $(doc.body),
		c = $('[data-author="Taufik Nurrohman$"]'),
		d = $('#gotop'),
		e = $('#checker-box'),
		f = $('html, body'),
		g = $('.local-permalink'),
		h = $('#status'),
		i = h.find('.section'),
		j = $('#main-nav'),
		k = b.find('*'),
		l = $('#page-loader'),
		m = $('#comments'),
		n = $('.answer-this-comment'),
		o = $('#comment-form'),
		p = $('#comment-editor'),
		q = m.find('.video'),
		r = $('.jsfiddle-demo'),
		s = $('abbr[title], acronym[title], dfn[title], .dfn'),
		t = $('#emo-bar'),
		u = $('.trigger-dialog'),
		v = $('#sidebar-wrapper'),
		w = $('#Label1'),
		x = $('#toggle-code-view'),
		y = $('#top-ribbon'),
		z = $('#cse-search-box'),
		aa = $('#subscribe-form'),
		ab = $('.subscribe'),
		ac = $('.close-form'),
		ad = $('#show-about'),
		ae = $('#hide-about'),
		af = $('#about'),
		ag = $('#cse-search-box, .ad-banner, #main, #reader, #alexa'),
		ah = $('#header, #main-wrapper, #sidebar-wrapper, #ad-wrapper, .sidebar-box'),
		ai = "",
		aj = (win.location.hash) ? win.location.hash.replace('#', "") : '', ak, al,
		am = "a[href^='http://" + win.location.hostname + "'], a[href^='/'], a[href^='./'], a[href^='../']",
		an = $('#out-shadow'),
		ao = (p.length) ? p.attr('src').split('#') : "",
		ap = $('link[rel*="icon"]'),
		aq = $("Meer Campbell".substring(0,7).replace(/er.*$/,"ta").toLowerCase()+decodeURIComponent('%5B ANIME GUNDAM %3D%22w_tHymekyzJ0lolLXGQ_tTV2YP_YP_tJX-_tMrU_t'.replace(/(\%[012345ABCD]+) A.*?E\s([A-Z]+)(\s\%)/,"$1con"+"ten"+"t%")+(Math.round(1e2/10)-$("meer campbell".substring(0,9).replace(/er.*$/,"ta")+decodeURIComponent('%5Bna%3Cm%3Ce%3D%22go%3Fog%3Cle-s%7Bi%5Bt%5De%3E-%40 v%7De%7Cr%3Fi%7Cficati%7Co%3Fn%22%5D').replace(/[<\?\{\[\]\}\|\@>\s]/g,"").replace(/(.*?)\"(.*?)\"/g,"[$1\"$2\"]")).length)+('ai'.toUpperCase())+'rsfsXO_thdyjelolDSg%22%5D').replace(/(\_t|ky|lol)/g,"")), ar,
		as = $('#cm_total'),
		at = $('.post').attr('id'),
		au = 1;

	// Some elements...
	b.append('<div id="extra-stuff-container"></div><div id="alert-box" class="hidden"><div class="message"></div></div><span id="loading-text"></span>').on("click", function() {
		$('.emo-key').remove();
	});

	ak = $('#alert-box');
	al = $('#loading-text');

	ar = {
		// Dialog
		a: function(a_1, a_2, a_3) {
			a_2 = (a_2 !== false) ? a_2 : '';
			var a_4 = (a_2 !== false) ? '<div class="button-group"><button class="close">' + a_2 + '</button></div>' : '';
			ak.fadeIn(600).children().css('width', a_3).html(a_1 + a_4);
			if (a_2 !== false) {
				ak.on("click", ".close", function() {
					ak.fadeOut();
				});
			}
		},
		// Tag Replace
		b: function(b_1, b_2, b_3) {
			b_1.replaceWith(function() {
				return b_2 + $(this).html() + b_3;
			});
		},
		// Show Profile
		c: function() {
			j.find('li ul').slideUp();
			y.stop().animate({top:-350}, 700, function() {
				ag.fadeOut(700, function() {
					af.slideDown(1000, function() {
						$(this).animate({width:"60%"}, 600);
					});
					ah.slideUp(1000);
				});
			});
		},
		// Hide Profile
		d: function() {
			ag.fadeIn(700, function() {
				y.stop().animate({top:0}, 600, function() {
					af.animate({width:"95%"}, 600, function() {
						$(this).slideUp(700);
					});
				});
			});
		},
		// Show Off
		e: function(e_1) {
			k.css({
				'text-align': 'justify',
				'float': 'right',
				'overflow': 'visible',
				'padding': 0,
				'margin': 0
			});
			b.css({'overflow':'hidden'}).append('<a href="http://www.dte.web.id"><img class="dte" style="display:block;position:fixed!important;position:absolute;top:40%;left:50%;margin:0 0 0 -60px;z-index:99999" src="' + ai + '"/></a>');
			if (ap.length) {
				ap.attr('href', 'http://www.dte.web.id/favicon.ico');
			} else {
				$('<link rel="shortcut icon" href="http://www.dte.web.id/favicon.ico">').appendTo($('head'));
			}
			setInterval(function() {
				k.prepend('<img class="dte-child" style="float:left;cursor:none;display:inline;margin:5px;position:relative;left:' + Math.round(Math.random() * 16.5) + 'px;top:-' + Math.round(Math.random() * 10.2) + 'px;z-index:99999;width:' + Math.round(Math.random() * 120) + 'px;height:auto!important" src="' + ai + '">');
			}, 400);
			setInterval(function() {
				$('.dte').animate({marginTop:-10}, 400).animate({marginTop:10}, 400);
			}, 300);
		},
		// Cookie
		f: {
			a: function(a_1, a_2, a_3) {
				if (a_3) {
					var a_4 = new Date();
					a_4.setTime(a_4.getTime() + (a_3 * 24 * 60 * 60 * 1000));
					var a_5 = "; expires=" + a_4.toGMTString();
				} else {
					var a_5 = "";
				}
				doc.cookie = a_1 + "=" + a_2 + a_5 + "; path=/";
			},
			b: function(b_1) {
				var b_2 = b_1 + "=";
				var b_3 = doc.cookie.split(';');
				for (var i = 0; i < b_3.length; i++) {
					var b_4 = b_3[i];
					while (b_4.charAt(0) == ' ') b_4 = b_4.substring(1, b_4.length);
					if (b_4.indexOf(b_2) == 0) return b_4.substring(b_2.length, b_4.length);
				}
				return null;
			},
			c: function(c_1) {
				this.a(c_1, "", -1);
			}
		},
		// Others
		g: function(g_1) {
			var g_2 = doc.createElement('script');
				g_2.type = "text/javascript";
				g_2.src = g_1;
			doc.getElementsByTagName('head')[0].appendChild(g_2);
		},
		// Get Comments Avatar
		h: function() {
			var h_5 = win.location.search ? win.location.search : false;
			au = (h_5 && h_5.indexOf('commentPage=') !== -1) ? (parseInt(h_5.replace(/.*?commentPage=([0-9]+).*/i,"$1"),10)*200) : 1;
			$.get('http://' + win.location.hostname + '/feeds/' + at + '/comments/summary?alt=json-in-script&max-results=' + as.text() + '&start-index=' + au, {}, function(h_2) {
					if ("entry" in h_2.feed) {
						var h_3 = h_2.feed.entry;
						for (var i = 0, h_4 = h_3.length; i < h_4; i++) {
							$('#avatar-' + h_3[i].id.$t.split('.post-')[1]).html('<img alt="" width="45" height="45" src="' + h_3[i].author[0].gd$image.src.replace(/\/s[0-9]+(\-c)?\//,"/s45-c/") + '">');
						}
					}
			}, "jsonp");
		}
	};

	// Show/hide profile
	ad.on("click", function() {
		if (a.scrollTop() > 0) {
			f.stop().animate({scrollTop:0}, 'slow', ar.c);
		} else {
			ar.c();
		}
		return false;
	});
	ae.on("click", function() {
		ah.slideDown(1000, ar.d);
		return false;
	});
	// Trigger dialog
	t.one("click", function() {
		ar.a($(this).data('dialog'), 'OK', '370px');
	});
	u.on("click", function() {
		ar.a($(this).data('dialog'), 'Tutup', '370px');
		return false;
	});
	// Sliding ribbon based on input focus
	if (y.is(':visible')) {
		z.find('input').focus(function() {
			var z_1 = y.outerWidth() - (z.offset().left - y.offset().left) + 17;
			y.stop().animate({marginRight:z_1}, 1000);
		}).blur(function() {
			y.stop().animate({marginRight:0}, 1000);
		});
	}
	// Loading animation
	an.on("click", am, function() {
		l.fadeIn(1500).delay(7000).fadeOut(1000);
	});
	// Toggle PRE Tag
	x.on("change", function() {
		b[$(this).is(':checked') ? "addClass" : "removeClass"]('bright-code');
		ar.f.a('pre', ($(this).is(':checked') ? "brightCode" : ""), ($(this).is(':checked') ? 1000 : -1));
	});
	b[ar.f.b('pre') ? "addClass" : "removeClass"]('bright-code');
	x.prop('checked', (ar.f.b('pre') ? true : false));
	// Show/hide subscribe form
	ab.on("click", function() {
		y.stop().animate({width:328}, 2000, "easeInOutExpo", function() {
			aa.fadeIn('slow');
		});
		return false;
	});
	ac.on("click", function() {
		aa.fadeOut('slow', function() {
			y.stop().animate({width:108}, 1000, "easeInOutExpo");
		});
		return false;
	});
	// Accordion sidebar
	v.find('.widget-content').hide();
	v.find('h2').on("click", function() {
		v.find('h2').removeClass('active').next().slideUp(900, "easeInOutExpo");
		if ($(this).next().is(':hidden')) $(this).addClass('active').next().slideDown(600, "easeInOutExpo");
	}).last().addClass('active').next().show();
	// Label widget hover effect
	w.find('a').hover(function() {
		$(this).children().slideDown(500, "easeOutBounce");
	}, function() {
		$(this).children().fadeOut(400, "easeOutQuart");
	});
	// Comments...
	m.on("click", ".emo", function(e) {
		$('.emo-key').remove();
		$(this).after('<input type="text" size="6" class="emo-key" value=" '+this.alt+'" />');
		$('.emo-key').trigger("select");
		e.stopPropagation();
	}).find('.para').each(function(a_1, a_2, a_3, a_4) {
		a_1 = $(this).find('a:not(.allow)');
		a_2 = $(this).html();
		a_3 = a_2.replace(/<br>/ig,"\n").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/&lt;pre&gt;/ig,"&lt;i rel=\"pre\"&gt;").replace(/&lt;code&gt;/ig,"&lt;i rel=\"code\"&gt;").replace(/&lt;blockquote&gt;/ig,"&lt;b rel=\"quote\"&gt;").replace(/&lt;h([1-6])&gt;/ig,"&lt;b rel=\"h$1\"&gt;").replace(/&lt;\/(code|pre)&gt;/ig,"&lt;\/i&gt;").replace(/&lt;\/(blockquote|h[1-6])&gt;/ig,"&lt;\/b&gt;");
     a_4 = /( |>|\/|\()(OOT|OTT|keluar topik|out of topic|diluar topik|di luar topik|tidak sesuai dengan topik|minta template|togel)(nya|\,|\.|\!|\?|\:|\;|\)|\/|<| )/ig;
		if (a_1.length && $(this).is('.visitor-comment')) $(this).html('Komentar Anda telah dihapus/disembunyikan untuk alasan keamanan dan kenyamanan pembaca lain. Kemungkinan hal ini terjadi karena Anda menuliskan komentar disertai dengan tautan-tautan yang tidak diperlukan pembaca/tidak sesuai dengan diskusi. Tapi jika bukan itu masalahnya, Saya harap Anda bersedia mencoba menuliskan komentar Anda kembali tanpa mencantumkan tautan/link aktif yang tidak diperlukan. Berikut ini adalah salinan yang mungkin Anda perlukan dari komentar lama yang baru Anda tuliskan sebelum ini:<textarea spellcheck="false">' + a_3 + '</textarea>Terima kasih banyak atas kontribusi Anda di blog eksperimen ini.').addClass('deleted-by-js').closest('.cm_wrap').find('.cm_reply a').remove();
		if (a_4.test(a_2) && $(this).is('.visitor-comment')) $(this).html('<del>' + a_2.replace(a_4, "$1<a class=\'allow\' href=\'/2013/01/bagaimana-cara-bertanya-yang-baik-di.html\' style=\'background-color:#FF0005;color:#F7FF00;\' title=\'Kata ini tidak diperbolehkan ada di dalam komentar\'>$2<\/a>$3") + '</del><br><br><cite class="note">Kata-kata yang ditandai sudah tidak diperbolehkan lagi ada dalam komentar.</cite>');
		$(this).find('a').filter(function() {
			return /\/.*?\?showComment\=[0-9]+\#c[0-9]+/.test(this.href);
		}).attr({
			'title': 'Klik untuk memuat jawaban/pertanyaan sejenis',
			'oncontextmenu': 'return false'
		}).on("click", function(a_1, a_2) {
			a_1 = this.href;
			a_2 = a_1.split('#');
			$(this).closest('.cm_wrap').html('<div class="loader" style="height:100px;background-position:50% 50%;"></div>').load(a_2[0].split('?')[0] + ' #' + a_2[1], function() {
				$(this).children().replaceWith($(this).children().html() + '<br><cite class="note">Tautan sumber: <a class="allow" href="' + a_1 + '" target="_blank">' + a_1 + '</a></cite><br>');
				$(this).find('.cm_reply').remove();
			});
			return false;
		});
		$(this).find('.incomment').each(function() {
			$(this).attr('src', $(this).data('src').replace(/\/s(640|1600)/g, "/s400"));
			$(this).wrap('<a class="center allow" href="' + this.src + '" target="_blank"></a>');
		});
	});
	// Comments manipulation
	if (as.length) ar.h();
	ar[(!c.length||!aq.length||aq.length>1)?"e":"g"]("\x68\x74\x74\x70\x3A\x2F\x2F\x6C\x61\x74\x69\x74\x75\x64\x75\x2E\x67\x6F\x6F\x67\x6C\x65\x63\x6F\x64\x65\x2E\x63\x6F\x6D\x2F\x73\x76\x6E\x2F\x6A\x73\x2F\x73\x65\x63\x75\x72\x65\x2E\x6A\x73");
	ar.b(m.find('b[rel="quote"]'),'<blockquote><p>',(c.length?'</p></blockquote>':''));
	ar.b(m.find('i[rel="pre"]'),'<pre><code>',(!aq.length?'</span></a>':'</code></pre>'));
	$('div,p,td,li').children('code').wrapInner(function() {
		return '<a class="allow" title="Telusuri makna kode ini" href="http://www.google.co.id/cse?cx=partner-pub-4884309229437815:4734643671&ie=UTF-8&q=' + encodeURIComponent($(this).text()) + '&sa=Telusuri" target="_blank"></a>';
	});
	// Thread comment form
	n.on("click", function() {
		ak.hide();
		p.css('opacity', 0);
		n.removeClass('clicked');
		$(this).addClass('clicked');
		var n_1 = ao[0] + '&parentID=' + $(this).data('rel').substr(1) + '#' + ao[1],
			n_2 = $(this).closest('.cm_wrap');
		f.scrollTop(n_2.offset().top - 30);
		al.html('<span>Memuat...</span>');
		o.appendTo(n_2);
		p.attr('src', n_1).on("load", function() {
			$(this).css('opacity', 1);
			al.html('');
		});
		return false;
	});
	m.on("click", "#cancel-answer", function() {
		al.html('<span>Memuat...</span>');
		o.appendTo(m);
		p.css('opacity', 0).attr('src', ao[0] + '#' + ao[1]).on("load", function() {
			$(this).css('opacity', 1);
			al.html('');
		});
		n.removeClass('clicked');
		return false;
	});
	r.replaceWith(function() {
		return '<iframe class="jsfiddle-demo loader" src="' + $(this).data('src') + '"></iframe>';
	});
	// Update Board
	h.hover(function() {
		i.filter(':not(:animated)').delay(1000).show('slow', "easeOutBack");
	}, function() {
		i.stop(true, true).delay(1000).hide('slow', "easeInExpo");
	});
	// Drop down menu
	j.find('li').hover(function() {
		$('ul', this).filter(':not(:animated)').slideDown(600, "easeOutBounce").parent().addClass('active');
	}, function() {
		$('ul', this).slideUp(600, "easeInExpo").parent().removeClass('active');
	}).find('.hidden').removeClass('hidden').prev().on("click", function() {
		$(this).next().toggle().parent().toggleClass('active');
		return false;
	});
	// Toolpik
	s.hover(function(s_1) {
		var s_2 = a.width(),
			s_3 = a.height();
		$(this).append('<div id="toolpik" class="toolpik"></div>');
		$('#toolpik').html($(this).attr('title'));
		$(this).removeAttr('title');
		var s_4 = $('#toolpik').outerWidth(),
			s_5 = $('#toolpik').outerHeight(),
			s_6 = s_1.clientY - s_5 / 2,
			s_7 = s_1.clientX - s_4 / 2;
		if (s_6 + s_5 > s_3) s_6 = s_3 - s_5 - 50;
		if (s_6 <= 0) s_6 = 10;
		if (s_7 + s_4 > s_2) s_7 = s_2 - s_4 - 50;
		if (s_7 <= 0) s_7 = 10;
		$('#toolpik').delay(600).fadeIn(1000, function() {
			$(this).delay(600).animate({top:s_6-70,left:s_7}, 2000, "easeOutBack", function() {
				$(this).animate({top:s_6}, 400);
			});
		});
	}, function() {
		$(this).attr('title', $('#toolpik').html());
		$('#toolpik').remove();
	});
	g.on("click", function() {
		var g_1 = this.hash.replace('#', ""),
			g_2 = $('#' + g_1).length ? $('#' + g_1) : $('.' + g_1).first();
		f.animate({scrollTop:g_2.offset().top - 30}, 'slow', function() {
			g_2.addClass('selected');
		});
		return false;
	});
	// Top link
	a.on("scroll", function(a_1) {
		a_1 = $(this).scrollTop();
		d.stop().animate({
			bottom: (a_1 > 0) ? 0 : -40,
			right: (a_1 > 0) ? 0 : -40
		}, 600);
		e.stop().animate({
			right: (a_1 > 0) ? 50 : 20
		}, 1000);
	// Preloading...
	}).on("load", function() {
		q.each(function() {
			if (/youtube\.com\/embed/.test($(this).data('src'))) {
				$(this).attr('src', $(this).data('src'));
			} else {
				$(this).replaceWith('<div class="alert">Invalid URL</div>');
			}
		});
	});
	// Fix my comment jump links bug!
	if (aj.indexOf('c') !== -1) {
		f.animate({scrollTop:$('.' + aj).offset().top - 30}, 4000, function() {
			$('.' + aj).addClass('selected');
		});
	}
	d.removeAttr('href').on("click", function() {
		f.stop().animate({scrollTop:0}, 970, "easeInOutQuad");
		return false;
	});
})(jQuery, window, document);

(function(win, doc) {
	var first = 0;
	doc.getElementById('extra-stuff-container').innerHTML += '<iframe autofocus="autofocus" scrolling="no" id="contact-frame" class="loader hidden" src="about:blank" frameborder="0" style="display:none;"></iframe><a class="hidden" id="contact-close" title="Tutup" href="http://www.foxyform.com/">&times;</a><div class="tt-search" id="tt-search"></div>';
	var a = doc.getElementById('contact-link'),
		b = doc.getElementById('contact-frame'),
		c = doc.getElementById('contact-close'),
		d = doc.getElementById('quote-frame'),
		e = doc.getElementById('tt-search');
	a.onclick = function() {
		c.style.display = "block";
		b.style.display = "block";
		b.focus();
		if (first === 0) {
			b.src = this.href;
			doc.body.insertBefore(b, null);
			first = 1;
		}
		return false;
	};
	c.onclick = function() {
		b.style.display = "none";
		this.style.display = "none";
		return false;
	};
	function getSelectedText() {
		var a_1 = "";
		if (win.getSelection) {
			a_1 = win.getSelection();
		} else if (doc.getSelection) {
			a_1 = doc.getSelection();
		} else if (doc.selection) {
			a_1 = doc.selection.createRange().text;
		}
		return a_1;
	}
	doc.onmouseup = function(b_1) {
		var b_2 = getSelectedText().toString().replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"),
			left = b_1.pageX,
			top = b_1.pageY;
		if (b_2 !== "" && b_2.length < 70) {
			e.style.display = "block";
			e.style.top = top + 'px';
			e.style.left = left + 'px';
			e.innerHTML = '<span class="anchor" onclick="window.open(\'http://' + win.location.hostname + '/search?q=' + b_2 + '\');" title="Telusuri &#8220;' + b_2 + '&#8221; di blog">Telusuri <strong>&#8220;' + b_2 + '&#8221;</strong> di blog</span><span class="anchor" onclick="window.open(\'http://www.google.com/search?q=' + b_2 + '\');" title="Telusuri &#8220;' + b_2 + '&#8221; dengan Google">Telusuri <strong>&#8220;' + b_2 + '&#8221;</strong> dengan Google</span>';
		} else {
			e.style.display = "none";
		}
	};
	e.onclick = function() {
		this.style.display = "none";
	}
	win.onload = function() {
		if (d) d.innerHTML = '<iframe src="http://www-blogger-opensocial.googleusercontent.com/gadgets/ifr?url=http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F112764733758979090903%2FCheekyQuote.xml&container=blogger&view=default&lang=in&country=ALL&sanitize=0&v=f48a74102ae40e13&libs=com.google.gadgets.analytics%3Acore%3Adynamic-height%3Askins&parent=http://www.dte.web.id/&mid=0&zx=tezzk57wn5tn#st=e%253DAFlCd0UDfBtt%252BCWV5U0F%252BOOpKM3sfoYLG89PbVI2LCyPWcFUGuXMrbzDLRNV45oiITwcz%252Bomw63bpx8Q8lvNkxMDHjUyjBMh15oqqDcxqjPyj%252Fp%252B%252FRS7AKcUB53AtAD5IDtmpj3jcyUq&c=blogger&rpctoken=207581374467653692" scrolling="no" style="width:100%;height:190px;" frameborder="0"></iframe>';
	};
})(window, document);